<!-- goodsDesc 商品描述-->
<template>
  <view v-if="details" class="goodsDesc">
    <view class="content html-img">
      <view class="fs30 b mb15">商品详情</view>
      <yy-html :content="details"></yy-html>
    </view>
  </view>
</template>

<script>
  export default {
    name: 'goods-desc',
    props: {
      details: String, // 购买须知
      tutorialUrl: String, // 使用教程
      type: String
    },
    data() {
      return {
        active: '1',
        list: []
      }
    },

    computed: {
      hasCinema() {
        return ['1', '3'].includes(this.type)
      }
    },
    created() {
      this.init()
    },
    methods: {
      // 初始化方法
      init() {
        this.initData()
      },
      initData() {
        const list = [
          { name: '购买须知', value: '1' },
          { name: '使用教程', value: '2', disabled: true }
        ]
        if (this.hasCinema) {
          // 1自有券 3自有卡
          list.push({ name: '可用影城', value: '3' })
        }

        this.list = list
      },
      handelClick(e) {
        console.log(e)
        if (e === '2') {
          this.toUrl()
        }
      }
    }
  }
</script>
<style lang="scss" scoped>
  .goodsDesc {
    background: #fff;
    margin-top: 30rpx;

    .content {
      padding: 20rpx 30rpx;
      width: 100%;
      box-sizing: border-box;
      font-size: 26rpx;
      color: $black;
    }
  }
</style>
